package asteroids;

import java.lang.Math;
import be.kuleuven.cs.som.annotate.*;

public class Asteroid extends FlyingObject {

	private final double childDirection;

	/**
	 * Creates a new asteroid with the given position, the given velocity, and
	 * the given size.
	 * 
	 * @param position
	 *            The starting position of the asteroid to be created
	 * @param velocity
	 *            The starting velocity of the asteroid to be created
	 * @param size
	 *            The size of the asteroid to be created.
	 * @post the new position of this new asteroid is equal to the given initial
	 *       position. |(new this).getPosition() == position
	 * @post the new velocity of this new asteroid is equal to the given initial
	 *       velocity. If the given velocity is a null element, we use a new
	 *       velocity that is zero in both directions as the provided velocity.
	 *       |if( velocity != null) (new this).getVelocity() == velocity | else
	 *       (new this).getVelocity() == new Velocity(0,0)
	 * @post the size of this new asteroid is equal to the given initial size. |
	 *       (new this).getSize() == size
	 * 
	 * @throws NullPointerException
	 *             This new asteroid cannot have the given position as its
	 *             position. |position == null
	 * @throws IllegalArgumentException
	 *             This new asteroid cannot have the given size as its size. |
	 *             !isValidSize(size)
	 */

	public Asteroid(Position position, Velocity velocity, 
			double size, double childDirection) {
		super(position, velocity, size,  (4.0 / 3.0) * Math.PI
				* Math.pow(size, 3) * 2650000000000D);
		this.childDirection = childDirection;

	}

	/**
	 * 
	 * @return |result == this.childDirection
	 */
	@Basic
	public double getChildDirection() {
		return this.childDirection;
	}
}
